<?php
/**
 * Pipahr
 *
 * @author Chin Win
 * @copyright 2013 pipahr.com
 */
require_once(OC_App::getAppPath('calendar') . "/lib/helper.php");
JLoader::register("PCalendarModellistview", OC_App::getAppPath('calendar') . "/lib/listview.php");

OCP\JSON::callCheck();
if(!OC_User::isLoggedIn()) {
   echo '您需要先登录';
   exit;
}

$objectid = JRequest::getInt('objectid', 0);
$object_model = new PCalendarModelObject();

$preview_info = $object_model->getEventPreviewInfo($objectid);
if ( !$preview_info ) {
   jexit(jsonError('没找到符合条件的日程！', null, false));
}

$objecttype = $preview_info['objecttype'];
if ( $objecttype == 'VEVENT' ) {
	$interviewers = $preview_info['interviewers'] ? $preview_info['interviewers'] : array();
}

if(!empty($interviewers)){
   foreach ($interviewers as $key=>$lists){
      echo'<div class="eachinterviewer"><span>'.$lists['start_time'].' - '.$lists['end_time'].'</span>'.strmaxtextlen($lists['show_name'],10).'</div>';
   }
exit();
}else {
   echo '系统错误';
   exit();
}
